package com.example.demo.controller;

import cn.creditease.std.JobAlloter;
import cn.creditease.std.factory.JobAlloterFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: kai.yang
 * @Date: 2019-08-13 10:00
 */
@RestController
@RequestMapping("/allot")
public class AllotTestController {

    @Autowired
    JobAlloterFactory jobAlloterManager;

    /**
     * 分发测试
     */
    @RequestMapping("test")
    public String test() {
        //模拟计算总条数有1000条数据
        int sum = 1000;
        String jobName = "test";
        int maxDuration = 1;
        JobAlloter alloter = jobAlloterManager.getAlloter(1000, jobName, maxDuration);
        alloter.start();
        return "ok";
    }


}
